/**
 * 
 */
package com.tw.trips.domain;

import org.neo4j.graphdb.Direction;
import org.springframework.data.neo4j.annotation.Fetch;
import org.springframework.data.neo4j.annotation.GraphId;
import org.springframework.data.neo4j.annotation.Indexed;
import org.springframework.data.neo4j.annotation.NodeEntity;
import org.springframework.data.neo4j.annotation.RelatedTo;

/**
 * @author m1005264
 * 
 */
@NodeEntity
public class ItHelps {

	@GraphId
	private Long id;

	@RelatedTo(type = "ITHELPS_COMMENT", elementClass = Comment.class, direction = Direction.BOTH)
	@Fetch
	private Comment comment;

	@RelatedTo(type = "ITHELPS", elementClass = Update.class)
	@Fetch
	private Update update;

	@RelatedTo(type = "ITHELPS_ACTIVITY", elementClass = Activity.class)
	@Fetch
	private Activity activity;

	@Indexed
	@Fetch
	public Traveller helps;

	public ItHelps(Comment comment, Traveller helps, Update update) {
		this.comment = comment;
		this.helps = helps;
		this.update = update;
	}

	public ItHelps() {
		super();
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the comment
	 */
	public Comment getComment() {
		return comment;
	}

	/**
	 * @param comment
	 *            the comment to set
	 */
	public void setComment(Comment comment) {
		this.comment = comment;
	}

	/**
	 * @return the helps
	 */
	public Traveller getHelps() {
		return helps;
	}

	/**
	 * @param helps
	 *            the helps to set
	 */
	public void setHelps(Traveller helps) {
		this.helps = helps;
	}

	/**
	 * @return the update
	 */
	public Update getUpdate() {
		return update;
	}

	/**
	 * @param update
	 *            the update to set
	 */
	public void setUpdate(Update update) {
		this.update = update;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "ItHelps [id=" + id + ", comment=" + comment + ", update="
				+ update + ", helps=" + helps + "]";
	}

	public Activity getActivity() {
		return activity;
	}

	public void setActivity(Activity activity) {
		this.activity = activity;
	}

}
